package com.book.system.servlet;

import com.book.system.common.R;
import com.book.system.service.ClassInfoService;
import com.book.system.service.impl.ClassInfoServiceImpl;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * @author ：oath
 * @date ：Created in 2024/4/28 0:03
 */
@WebServlet(name = "ClassInfoServlet", urlPatterns = "/classInfo")
public class ClassInfoServlet extends BaseServlet {

    //创建业务层
    private final ClassInfoService classInfoService = new ClassInfoServiceImpl();

    /**
     * 获取图书类型列表
     *
     * @param request  请求对象
     * @param response 响应对象
     * @return list
     */

    public R<List<Map<String, Object>>> getList(HttpServletRequest request, HttpServletResponse response) {
        List<Map<String, Object>> list = classInfoService.getList();
        return R.success(list);
    }
}